package org.gdstash.ui.table;

import org.gdstash.item.GDItem;
import org.gdstash.util.GDMsgFormatter;

import javax.swing.*;

public class GDMassImportRow {
    public static final Class[] COLUMN_CLASSES;
    public static String[] columnNames;
    public GDItem item;
    public boolean valid;
    public String baseName;
    public boolean hardcore;
    public boolean selected;
    public ImageIcon validIcon;
    public ImageIcon icon;
    public GDItem.LabelInfo name;
    public GDItem.LabelInfo level;
    public GDItem.LabelInfo prefix;
    public GDItem.LabelInfo suffix;
    public GDItem.LabelInfo modifier;
    public GDItem.LabelInfo component;
    public GDItem.LabelInfo bonus;
    public GDItem.LabelInfo enchantment;
    public GDItem.LabelInfo seed;
    public GDItem.LabelInfo charName;
    public ImageIcon hcIcon;

    public static void updateColumnNames() {
        if (GDMassImportRow.columnNames == null) {
            GDMassImportRow.columnNames = new String[GDMassImportRow.COLUMN_CLASSES.length];
        }
        GDMassImportRow.columnNames[0] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_SELECT");
        GDMassImportRow.columnNames[1] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_VALID");
        GDMassImportRow.columnNames[2] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_PICTURE");
        GDMassImportRow.columnNames[3] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_ITEM_NAME");
        GDMassImportRow.columnNames[4] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_LEVEL");
        GDMassImportRow.columnNames[5] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_PREFIX");
        GDMassImportRow.columnNames[6] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_SUFFIX");
        GDMassImportRow.columnNames[7] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_MODIFIER");
        GDMassImportRow.columnNames[8] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_COMPONENT");
        GDMassImportRow.columnNames[9] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_COMPLETION_BONUS");
        GDMassImportRow.columnNames[10] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_ENCHANTMENT");
        GDMassImportRow.columnNames[11] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_SEED");
        GDMassImportRow.columnNames[12] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_CHAR_NAME");
        GDMassImportRow.columnNames[13] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_HARDCORE");
    }

    static {
        COLUMN_CLASSES = new Class[]{Boolean.class, Icon.class, Icon.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, Icon.class};
        GDMassImportRow.columnNames = null;
        updateColumnNames();
    }
}
